#ifndef PAGE5_WIDGET_H
#define PAGE5_WIDGET_H


#include <QWidget>
#include <QDebug>
#include <stdio.h>
#include <string.h>
#include <QProcess>
#include <QTimer>
//#include "user/welcomewidget.h"
#include "ui_welcomewidget.h"
#include "page5_widget/update_dialog.h"
#include "page5_widget/setmaster_dialog.h"

class WelcomeWidget;


#define OPEN_DOOR    0x01    //开门
#define CLOSE_DOOR   0x02    //关门

#define SERIAL_PORT_TX    0x01
#define SERIAL_PORT_RX    0x02

#define MASTER_SCAN_TIMEOUT_VALUE    10000

class Page5_Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Page5_Widget(WelcomeWidget *widget);
    ~Page5_Widget();

signals:
    void signal_write_sp_tx_queue(char *s,unsigned int len);

private slots:
    void on_pb_update_clicked();
    void on_pb_time_update_clicked();
    void slot_time_update_finished(int exit_code, QProcess::ExitStatus exit_status);
    void on_pb_set_master_clicked();
    void on_pb_reset_master_clicked();
    void on_pb_master_scan_clicked();

    void buttontimer_timeout_handler();

private:
    WelcomeWidget *welcomewidget;
    Ui::WelcomeWidget *welcome_ui;
};

#endif
